/*
 * =====================================================================================
 *
 *       Filename:  fs.h
 *
 *    Description:  this file include the inode struct , block struct,super_block struct and
 *    some other struct about the file.
 *    in my opinion longx's filesystem should ext2,ext3,fat32 and the ntfs the linux kernel include
 *    many description about the filesystem i can use them. 
 *
 *        Version:  1.0
 *        Created:  2010年11月16日 21时15分07秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  lonelydragon 
 *        Company:  
 *
 * =====================================================================================
 */
/*
 * how to make the filesystem can describe a more large file.
 */
#ifndef _FS
#define _FS



#define NAME_LEN 13



#include <kernel.h>
#include <time.h>
#include <sched.h>
/*
 * this is the inode in the disk
 */
struct d_inode
{
	unsigned short 		i_mode;  //open mode
	unsigned short 		i_uid;
        unsigned long 		i_size;
	unsigned char 		i_gid;
	unsigned short 		i_count;
	unsigned long 		i_time;
	unsigned short 		i_zone[9];
};
/*
 * this is the node int the memory
 */
struct m_inode
{
	unsigned short 		i_mode;  //open mode
	unsigned short 		i_uid;
	unsigned long 		i_size;
	unsigned char 		i_gid;
	unsigned short 		i_count;
	unsigned long 		i_time;
	unsigned short 		i_zone[9];
	/*
	 * this is begin to different from the m_inode;
	 */
	struct task_struct  *wait_queue;
	unsigned long 	i_atime; //last time to visit the inode
	unsigned long 	i_ctime; //last time change the inode
	unsigned short 	i_dev; //dev num;
	unsigned short 	i_num;
	unsigned short 	i_linkcount;
	unsigned char 	i_lock;
	unsigned char  	i_dirt;
	unsigned char 	i_pipe;
	unsigned char 	i_mount;
	unsigned char 	i_seek;
	unsigned char 	i_update;
};

/*
 * this is the main inode
 */
struct inode
{
	unsigned long 	i_size; 			//file length;
	unsigned short 	i_nodenum; 			//node number
	unsigned short 	i_uid;                           //user id
	unsigned char 	i_gid;
	unsigned long 	i_atime;
	unsigned long 	i_ctime;
    	struct task_struct *list_head;
     	struct m_inode *mem_inode;
     	struct d_inode *ind_inode;
};
struct file{
	struct 	m_inode node[9];
	off_t 	offset;
};
struct m_super_block
{
	
};
struct super_block{

};


